<template>
	<view class="bigView">
		<z-paging ref="paging" :show-default-loading-more-text="false" v-model="dataList" @query="queryList" :auto="false">
			<view slot="top" style="display: flex;justify-content: center;background-color: white;flex-direction: column;">
				<navBar slot="top" title="航嘉行政"></navBar>
				<!-- <u-tabs :list="list1" @click="click"></u-tabs> -->
				<u-tabs style="font-size: 14px;" :activeStyle="{
					color: '#1875FF',
					fontWeight: 'bold',
					transform: 'scale(1.05)',
					fontSize:'14px'
				}" :inactiveStyle="{
					color: '#00000080',
					transform: 'scale(1)',
					fontSize:'14px'
				}" lineColor='#1875FF' :list="list1" :current="clubType" @click="click"></u-tabs>
			</view>
			<view class="itemView" v-for="(item, index) in dataList" :key="index" @click="itemHandle(item)">
				<view class="itemTitle">
					<view style="color: #000000;font-size: 16px;">{{item.theme}}</view>
					<!-- <view style="color: #247BFD;font-size: 14px">{{item.createdAtView}}</view> -->
				</view>
				<view class="itemContent">
					{{item.createdAtView}}
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import dictDetail from '@/api/dictDetail.js'
	import club from '@/api/club.js'
	export default{
		components:{
			
		},
		data(){
			return {
				bottom:0,
				indexList:[1,25,5,6],
				result:{},
				clubType:0,
				dataList:[],
				list1: [],
			}
		},
		mounted() {
			uni.getSystemInfo({success: (e) => {
				// this.StatusBar = e.statusBarHeight;
				let custom = wx.getMenuButtonBoundingClientRect();
				this.bottom = custom.bottom;
				// this.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
				// this.TopHeight = this.CustomBar+100;//this.StatusBar+this.CustomBar;
			}})
			this.dictDetail()
		},
		onLoad(options) {
			if(options.clubType){
				this.clubType = options.clubType;
			}
			// this.listRequest()
		},
		methods:{
			dictDetail(){
				dictDetail.dictDetailHandle({dictName:'CLUB_TYPE',enabled:1,page:1,size:999}).then(res =>{
					this.list1 = res.records;
					for(let i=0;i<this.list1.length;i++){
						this.list1[i]['name'] = this.list1[i]['label']
					}
					this.$refs.paging.reload()
				}).catch(error =>{
					
				})
			},
			click(item) {
				// this.industrialType = item.index+1
				const items = this.list1[item.index]
				this.clubType = items.value;
				this.$refs.paging.reload()
				// this.newsListRequest(item.index+1)
			},
			scrolltolower() {
				// this.loadmore()
			},
			sureHandle(){
				uni.navigateBack()
			},
			queryList(pageNo, pageSize) {
				club.listHandle({page:pageNo,size:pageSize,clubType:this.clubType}).then(res =>{
					let records = res.records;
					if(pageNo==1){
						this.dataList = records;
					}else{
						this.dataList.concat(records)
					}
					this.$refs.paging.complete(records);
				}).catch(error =>{
					this.$refs.paging.complete(false);
				})
			},
			itemHandle(item){
				// uni.navigateTo({
				// 	url: '/packageHome/pages/carbonNeutrality/detail?id='+item.id +"&sourceType=4"
				// })
				uni.navigateTo({
					url: '/packageDcjy/pages/club/detail?id='+item.id
				})
			},
		},
		onReady() {
			
		}
	}
</script>

<style lang="scss" scoped>
.bigView{
	width: 100vw;
	height: 100vh;
	background-color: #F7F7F7;
	display: flex;
	flex-direction: column;
}
.topView{
	flex-grow: 1;
	// width: 100vw;
	// background-color: green;
	display: flex;
	flex-direction: column;
	width: 100vw;
	overflow-y: auto;
}
.itemView{
	display: flex;
	flex-direction: column;
	width: calc(100vw - 32px);
	border-radius: 12px;
	margin-left: 16px;
	// padding: 12px;
	background-color: white;
	margin-top: 8px;
	.itemTitle{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 12px;
	}
	.itemContent{
		padding: 0 12px 12px 12px;
		font-size: 12px;
		color: #333333;
		// margin-top: 12px;
	}
}
</style>